 const app=getApp()
 var url=app.globalData.url
Page({

  /**
   * 页面的初始数据
   */
  data: {
     names:"维修师",
     flag:false,
    index:0,
    eng:[1,2],
    inTab:0,
    op1:0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const that=this
    that.getEnlist("计算机")
  },
  selects(e){
    const that=this
    that.setData({
      inTab:e.currentTarget.id
    })
    that.getEnlist(e.currentTarget.dataset.name)
  },
  getEnlist(name){
    const that=this
    wx.request({
      url: url +'/engineer/red_engineer',
      data:{
        menuName:name
      },
      header:{
        "content-type":"application/json"
      },
      success(res){
        console.log(res.data)
        if(res.data.code===1){
          that.setData({
            eng: res.data.data.engineers
          })
        }
      }
    })
  },
  selectred(){
    const that=this
    that.setData({
      index:0,
      op1:0
    })
  },
  selectblack() {
    const that = this
    that.setData({
      index:1,
      op1:1
    })
  },
  toOthser(e) {

    console.log("跳转到师傅详情"+e.currentTarget.id)
    wx.navigateTo({
      url: '../endetail/endetail?mid='+e.currentTarget.id,
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    app.editTabBar();
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})